;Dit programma configureert de pinnen van poort B als uitgang, en zet vervolgens alle pinnen hoog.

;Files required:   P16F876A.inc
;Assembler directives:

	LIST      p=16f876a      	; List directive to define processor
	INCLUDE   "P16F876A.inc" 	; Processor specific variable definitions
	
	__CONFIG	_CP_OFF & _DEBUG_OFF & _LVP_OFF & _PWRTE_ON & _WDT_OFF & _BODEN_OFF & _HS_OSC 

; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.


;Memory definition:
hoog	EQU	h'20'

;Main program:

	ORG	0			; Reset vector
	CALL	Init			; Setup hardware input/output

Loop	MOVLW	b'11111111'		; Move Count into W
	MOVWF	PORTB			; Write W to portb
	GOTO	Loop			
	
;Subroutines:
	
Init	CLRF	PORTB			; All of portb low
Bank1					; Change to bank1
	CLRF	TRISB			; All of portb outputs
Bank0					; Back to bank0
	RETURN

	END				; Kristof Goris